Scrap Ship at Player HQ by eladan v2.02
---------------------------------------

Allows player to scrap a ship at the player HQ and retrieve resources roughly equivalent to what would be required to build a ship of the same type, less any damage the ship has sustained, and small variable amounts as a 'wear and tear' cost. It will only give the required wares, not the credits that would be required for building the ship - consider it depreciation!

You can't run this on the player ship (for obvious reasons.)

On installing the script, two new commands will appear -  one in the special command menu, 'Scrap Ship at Player HQ', and one in the additional ship commands menu 'Report approx Build/RE costs'

The ship will attempt to fly to the HQ if it is not currently docked there. It won't currently use a jumpdrive if installed - partly through design, although I'll consider any feedback on the issue. When the ship arrives at the HQ, it will be stripped of any equipment and cargo (but not software upgrades - hence my decision on jumpdrives) and will then spend approx. 10% of the time it takes to build/RE the same type of ship to recycle the ship. The ship name will change to reflect the progress towards recycling the ship. Issuing any command during the recycling process (including reissuing the scrap ship command) will abort the recycling process, losing all progress.

As I already mentioned, the amount of resources returned is roughly the amount which would be required to build the ship. Check Dave Toomes HQ production costs Excel file to determine what you would get if you are unsure. Alternatively, I have now added an extra command iin the additional ship commands which generates a report on what resources the same type of ship would need if it was built/RE'd at the player HQ. Credit to Dave for his work on the HQ production costs, as the values I have used are based on the values he uses in that file.

The script uses COMMAND_TYPE_SPECIAL_56, COMMAND_TYPE_SHIP_38 and text file [44,49]8235/page id 8235.

Changelog
---------
v2.02
- Fix for command being interrupted forcing command to be rerun twice to scrap ship again
- Corrected time factor for scrapping and reporting build/RE time for Goner ships

v2.01
- Added German translation by finnTO (Thanks finnTO!)

v2.00
- Script restructure.
- Ships will now take around 10% of the time it would take to build the ship to be recycled.
- Ship name will change to reflect the progress of recycling (percentage and time left)
- Running the command a second time before recycling is finished, or issuing any command to the ship will abort the recycling process, losing any progress.
- fixed wear and tear cost at 5%. There will still also be random reductions of certain resource amounts on top of that.
- Added new command in the additional ship commands which will report on approximate build/RE costs at the HQ for that ship. This command can be run on any ship, and does nothing but generate the report.

v1.20
- Changed code for calculating ship value for recycling (code by Jakesnake5 - thanks Jake!)
- Removed command from playership menu
- Slightly randomises amounts returned from recycling - some wares will lose more than others (ore/silicon)
- Added check for more khaak ships - just in case anyone gets one somehow
- Will always return at least 1 unit of the primary resources - Energy Cells, Ore, Silicon, Teladianium, Crystals, and Nividium (if khaak)

v1.10
- Fixed bug for script not checking if enough storage existed before recycling
- Fixed bug for khaak ships not providing nividium from recycling
- Fixed low relval ships not supplying resources
- Added script setup check for HQ to disable command if HQ not yet built
- Added log entry giving resource amounts recovered when recycling
- General script cleanup and improvement

v1.00
- Initial release





